﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PasswordModify.aspx.cs" Inherits="LabMS.Web.User.PasswordModify" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>修改密码</title>
    <link type="text/css" rel="stylesheet" href="../style/screen.css" />
    <!--[if lte IE 6]>
    <link type="text/css" rel="stylesheet" href="../style/ie6.css" />
    <![endif]-->
    <!--[if lte IE 7]>
    <link type="text/css" rel="stylesheet" href="../style/ie7.css" />
    <![endif]-->
</head>
<body>
    <form id="form1" runat="server">
        <div class="main">
            <div id="pageInfo" class="clearfix">
                <div class="title">
                    <label>修改密码</label>
                </div>
            </div>
        </div>
        <div class="main">
            <p>
                <label>用户名:</label>
                <asp:TextBox ID="UserNameTBX" runat="server"></asp:TextBox>
                <asp:TextBox ID="UserCodeTBX" runat="server" style="display:none;"></asp:TextBox>
            </p>
            <p>
                <label>旧密码:</label>
                <asp:TextBox ID="UserPasswordTBX" runat="server" TextMode="Password"></asp:TextBox>
            </p>
            <br />
            <p>
                <label>新密码:</label>
                <asp:TextBox ID="NewPasswordTBX" runat="server" TextMode="Password"></asp:TextBox>
            </p>
            <p>
                <label>重复新密码:</label>
                <asp:TextBox ID="RePasswordTBX" runat="server" TextMode="Password"></asp:TextBox>
            </p>
            <p>
                <asp:Button ID="SaveBtn" CssClass="button" runat="server" OnClick="Save_OnClick" Text="确定" />
                <input id="concelbtn" runat="server" value="返回" type="button" class="button" onclick="javascript:window.close();" />
            </p>
        </div>
    <asp:TextBox ID="UserTypeTBX" runat="server" style="display:none"></asp:TextBox>
    </form>
    <script type="text/javascript" src="../js/jQuery/jquery-1.3.1.js"></script>

    <script type="text/javascript" src="../js/jQuery/jquery.tooltip.js"></script>

    <script type="text/javascript" src="../js/jQuery/jquery.validate.js"></script>

    <script type="text/javascript">
        $(function(){
            $("#form1").validate({
                rules: {
                    UserPasswordTBX: {
                        required: true,
                        maxlength: 50,
                        remote:{
                            data:{
                                Password:function(){
                                    return $("#UserPasswordTBX").val();
                                    },
                                UserCode:function(){
                                    return $("#UserCodeTBX").val();
                                    },
                                UserType:function(){
                                    return $("#UserTypeTBX").val();
                                    }
                                 },
                             url:"CheckUserNameAndPsw.ashx",
                             type:"get"
                               }
                    },
                    NewPasswordTBX: {
                        required: true,
                        maxlength: 50,
                         remote:{
                            data:{
                                Password:function(){
                                    return $("#NewPasswordTBX").val();
                                    }
                                 },
                             url:"CheckPassword.ashx",
                             type:"get"
                               }
                    },
                    RePasswordTBX: {
                        required: true,
//                        maxlength: 50,
//                         remote:{
//                            data:{
//                                Password:function(){
//                                    return $("#RePasswordTBX").val();
//                                    }
//                                 },
//                             url:"CheckPassword.ashx",
//                             type:"get"
//                               },
                        equalTo: "#NewPasswordTBX"
                    }
                },
                messages: {
                    UserPasswordTBX: {
                        required: "请输入旧密码",
                        maxlength: "密码长度不能超过50个字符",
                        remote: "密码输入不正确!"
                    },
                    NewPasswordTBX: {
                        required: "请输入新密码",
                        maxlength: "密码长度不能超过50个字符",
                        remote: "用户密码输入不合法(只能为数字、下划线和英文的组合)"
                    },
                    RePasswordTBX: {
                        required: "请重复输入新密码",
//                        maxlength: "密码长度不能超过50个字符",
//                        remote: "用户密码输入不合法(只能为数字、下划线和英文的组合)",
                        equalTo: "两次密码输入不一致"
                    }
                   
                }
            });
        });
    </script>

</body>
</html>
